﻿using System;
using System.Collections.Generic;
using System.Linq;
using ExpenseSystem.Common;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;

namespace ExpenseSystem.Fether
{
    public class TitleQuoteFetcher : NormalFetcher<TitleQuoteModel>, IDetailFetcher<TitleQuoteModel>
    {
        public IList<TitleQuoteModel> ListByMainId( long site, long mainId, out string message,out int rows)
        {
            IList<TitleQuoteModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out rows, Restrain.Eq("QuoteId", mainId).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
        public IList<TitleQuoteModel> ListByTitle( long site, long title, out string message,out int rows)
        {
            IList<TitleQuoteModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out rows, Restrain.Eq("TitleId", title).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
    }
}